package com.atguigu.tingshu.user.service;

import com.atguigu.tingshu.model.user.UserInfo;
import com.atguigu.tingshu.vo.user.UserInfoVo;
import com.atguigu.tingshu.vo.user.UserPaidRecordVo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

public interface UserInfoService extends IService<UserInfo> {

    /**
     * 微信一键登录
     * @param code 调用微信接口使用临时code 有效期5分钟，仅能使用一次
     * @return {token:"令牌"}
     */
    Map<String, String> wxLogin(String code);

    /**
     * 根据用户ID查询用户信息
     * @param userId
     * @return
     */
    UserInfoVo getUserInfo(Long userId);

    void updateUser(Long userId, UserInfoVo userInfoVo);

    Map<Long, Integer> userIsPaidTrack(Long userId, Long albumId, List<Long> needCheckPayStatusTrackIds);

    Boolean isPaidAlbum(Long albumId, Long userId);

    List<Long> getUserPaidTrackList(Long userId, Long albumId);

    void savePaidRecord(UserPaidRecordVo userPaidRecordVo);
}
